
// test on qemu -M virt -nographic -cpu cortex-a57
_start:
    ldr x10, =0x09000000

_pl011_set:

    mov x0, #0x0
    // uartcr enalbe tx,rx
    str w0, [x10, 0x30] // uartcr

    mov x0, 0x0
    str w0, [x10, 0x4] // uartecr

    mov x0, 0x60  // lcr_word_length8
    str w0, [x10, 0x2c]  // uartlcr_h

    mov x0, 0x27   // ibrd_div_38400
    str w0, [x10, 0x24]

    mov x0, 0x9   // fbrd_div_38400
    str w0, [x10, 0x28]

    mov x0, xzr
    str w0, [x10, 0x38]  // imsc, mask and clear all interrupts
    
    mov x0, 0x7ff
    str w0, [x10, 0x44] // icr

    mov x0, #0x301
    // uartcr enalbe tx,rx
    str w0, [x10, 0x30] // uartcr


_loop:    
    mov x0, 'a'
    strb w0, [x10]
    mov x0, '\n'
    strb w0, [x10]
    mov x0, '\r'
    strb w0, [x10]
    b _loop
    
    